package com.ld.hpfs.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ld.hpfs.dao.TicketTypeMapper;
import com.ld.hpfs.service.TicketTypeService;
@Service
public class TicketTypeServiceImpl implements TicketTypeService{
	
	private static final Logger logger = LoggerFactory.getLogger(TicketTypeServiceImpl.class);
	@Autowired
	private TicketTypeMapper tickettypemapper;
	
	@Override
	public int TicketInvoiceSetting(HashMap<String,Object> param){
		try{
			tickettypemapper.TicketInvoiceDelete(param);
			tickettypemapper.TicketInvoiceSetting(param);
			return 0;
		}catch (Exception ex){
			logger.debug("{}",ex);
			return -1;
		}
	}
	@Override
	public ArrayList<HashMap<String,Object>> getInvoiceData(HashMap<String,Object> param){
			return tickettypemapper.getInvoiceData(param);
	}
	
	@Override
	public int VaildCompany(HashMap<String,Object> param){
		return tickettypemapper.VaildCompany(param);
	}
	@Override
	public int checkLevel(HashMap<String, Object> param) {
		int count=tickettypemapper.checkLevelCount(param);
		if (count>0){			
			return tickettypemapper.checkLevel(param);
		} else {
			return 0;
		}
	}
	@Override
	public int checkAbandon(HashMap<String, Object> param) {
		return tickettypemapper.checkAbandon(param);
	}

}
